<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue</title>
</head>
<body>
<div id="app">
  <div v-show="isVisible">hello</div>
  <button @click="toggleVisible">切换是否显示</button>
</div>
<script src="vue.js"></script>
<script>
    var vm = new Vue({
        el:'#app',
        data:{
            isVisible:true
        },
        methods:{
            toggleVisible(){
                this.isVisible=!this.isVisible;
            }
        }
    })

   /*  document.addEventListener('scroll',()=>{
        console.log('scroll')
    },{passive:true});//告诉 浏览器我不可以算阻止事件的默认行为 event.preventDefault() */
</script>
</body>
</html>